package com.hospital.warehouse.recovery.entity;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hospital.registermanagement.entity.Pharmacy;
import com.hospital.warehouse.drugdicts.entity.Drugdicts;
import com.hospital.warehouse.instock.entity.Instock;
import com.hospital.warehouse.storehouse.entity.Storehouse;
import com.hospital.warehouse.sys_user.entity.Sys_user;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author Mr. YR
 * @since 2020-04-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("recovery")
public class Recovery extends Model<Recovery> {

	private static final long serialVersionUID = 1L;

	@TableId(value = "re_id", type = IdType.AUTO)
	private Integer re_id;

	@TableField("re_is_id")
	private Integer re_is_id;
	@TableField(exist = false)
	private Instock instock;

	@TableField(exist = false)
	private Drugdicts drug;

	@TableField("re_num")
	private Integer re_num;
	@TableField(exist = false)
	private Integer re_num_min;
	@TableField(exist = false)
	private Integer re_num_max;

	@TableField("re_source")
	private String re_source;

	@TableField(exist = false)
	private Storehouse fromstorehouse;

	@TableField(value = "re_frompharmacyid", updateStrategy = FieldStrategy.IGNORED)
	private Integer re_frompharmacyid;
	@TableField(exist = false)
	private Pharmacy frompharmacy;

	@TableField("re_reason")
	private String re_reason;

	@TableField("re_remark")
	private String re_remark;

	@TableField("re_toroomid")
	private Integer re_toroomid;
	@TableField(exist = false)
	private Storehouse tostorehouse;

	@TableField("re_applicantid")
	private Integer re_applicantid;
	@TableField(exist = false)
	private Sys_user applicant;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@TableField("re_recoverytime")
	private Date re_recoverytime;
	@TableField(exist = false)
	private String re_recoverytime_interval;
	@TableField(exist = false)
	private Date re_recoverytime_min;
	@TableField(exist = false)
	private Date re_recoverytime_max;

	@TableField("re_state")
	private String re_state;

	@TableField("re_confirmid")
	private Integer re_confirmid;
	@TableField(exist = false)
	private Sys_user confirm;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@TableField("re_confirmtime")
	private Date re_confirmtime;
	@TableField(exist = false)
	private String re_confirmtime_interval;
	@TableField(exist = false)
	private Date re_confirmtime_min;
	@TableField(exist = false)
	private Date re_confirmtime_max;

	@TableField("flag")
	private Integer flag;

	@Override
	protected Serializable pkVal() {
		return this.re_id;
	}

}
